package com.kt.mes.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kt.mes.mapper.StorageInRecordMapper;
import com.kt.mes.domain.StorageInRecord;
import com.kt.mes.service.IStorageInRecordService;

/**
 * 入库记录Service业务层处理
 * 
 * @author lzc
 * @date 2021-01-25
 */
@Service
public class StorageInRecordServiceImpl implements IStorageInRecordService 
{
    @Autowired
    private StorageInRecordMapper storageInRecordMapper;

    /**
     * 查询入库记录
     * 
     * @param id 入库记录ID
     * @return 入库记录
     */
    @Override
    public StorageInRecord selectStorageInRecordById(Long id)
    {
        return storageInRecordMapper.selectStorageInRecordById(id);
    }

    @Override
    public StorageInRecord countInByCreateTime(Map map) {
        return storageInRecordMapper.countInByCreateTime(map);
    }

    /**
     * 查询入库记录列表
     * 
     * @param storageInRecord 入库记录
     * @return 入库记录
     */
    @Override
    public List<StorageInRecord> selectStorageInRecordList(StorageInRecord storageInRecord)
    {
        return storageInRecordMapper.selectStorageInRecordList(storageInRecord);
    }

    /**
     * 新增入库记录
     * 
     * @param storageInRecord 入库记录
     * @return 结果
     */
    @Override
    public int insertStorageInRecord(StorageInRecord storageInRecord)
    {
        storageInRecord.setCreateTime(DateUtils.getNowDate());
        return storageInRecordMapper.insertStorageInRecord(storageInRecord);
    }

    /**
     * 修改入库记录
     * 
     * @param storageInRecord 入库记录
     * @return 结果
     */
    @Override
    public int updateStorageInRecord(StorageInRecord storageInRecord)
    {
        storageInRecord.setUpdateTime(DateUtils.getNowDate());
        return storageInRecordMapper.updateStorageInRecord(storageInRecord);
    }

    /**
     * 批量删除入库记录
     * 
     * @param ids 需要删除的入库记录ID
     * @return 结果
     */
    @Override
    public int deleteStorageInRecordByIds(Long[] ids)
    {
        return storageInRecordMapper.deleteStorageInRecordByIds(ids);
    }

    /**
     * 删除入库记录信息
     * 
     * @param id 入库记录ID
     * @return 结果
     */
    @Override
    public int deleteStorageInRecordById(Long id)
    {
        return storageInRecordMapper.deleteStorageInRecordById(id);
    }
}
